<template>
  <div id="gsglBox">
    <el-row style="margin-bottom: 10px">
      <el-row>
        <el-button size="small" type="success" @click="handleCustomFormula">自定义公式</el-button>
        <el-button size="small" type="danger" @click="handleDelete()" :disabled="!multipleForms.length">全部删除</el-button>
      </el-row>
    </el-row>
    <!-- 遍历出来的表格 -->
    <el-scrollbar :height="height" ref="scrollbarRef" v-loading="loading">
      <div v-for="(item, index) in multipleForms" class="mutipleFormsClass">
        <el-form :model="item" label-width="80">
          <el-form-item label="公式表示：" prop="tableType">
            <div :class="'formulation' + index + 1"></div>
          </el-form-item>
          <el-form-item label="公式条件：" prop="formulaConditionDisplay">
            {{ item.formulaConditionDisplay }}
          </el-form-item>
          <el-form-item label="适用方法：" prop="methodName" v-if="item.methodName">
            {{ item.methodName }}
          </el-form-item>
          <el-form-item label="适用类别：" prop="jclbName" v-if="item.jclbName">
            {{ item.jclbName }}
          </el-form-item>
          <el-form-item label="备注：" prop="remark" v-if="item.remark">
            {{ item.remark }}
          </el-form-item>
        </el-form>
        <el-row justify="end" style="margin-bottom: 10px">
          <el-button type="success" @click="copyFormula(item.formulaId)">复制</el-button>
          <el-button type="success" @click="editFormula(item.formulaId)">编辑</el-button>
          <el-button type="danger" @click="handleDelete(item.formulaId)">删除</el-button>
        </el-row>
      </div>
      <div style="height: 20px"></div>
    </el-scrollbar>
    <el-dialog :class="'el-dialog-theme3'" append-to-body draggable fullscreen
      :close-on-click-modal="false" v-model="customOpen" v-if="customOpen" title="自定义公式" @close="dialogClose">
      <el-form :model="diyFormulaForm" ref="diyFormulaFormRef" label-width="80" :rules="diyFormulaRules">
        <el-row>
          <p class="pinformation">字段清单</p>
          <el-row style="padding-bottom: 5px; margin-left: 20px">
            <el-button link style="margin-left: 15px" icon="plus" @click="handleOtherControls">选择其它控件</el-button>
          </el-row>
        </el-row>
        <el-button link v-for="item in componentList" :key="item.componentId" :componentId="item.componentId"
          :tableId="item.tableId" style="margin: 0 10px"
          @click="insert(item.componentName, item.componentId, item.tableId)" class="formula_but"
          :style="`color: ${item.isOther ? '#ab00ff' : 'var(--theme-deep-color)'} !important`">{{
            item.componentName
          }}</el-button>
        <p class="pinformation" style="margin-top: 15px">公式</p>
        <el-row>
          <el-col :span="5">
            <el-form-item prop="resultId" label-width="0">
              <el-select style="width: 100%" clearable filterable placeholder="请选择公式" v-model="diyFormulaForm.resultId">
                <el-option v-for="item in componentList" :key="item.componentId" :label="item.componentName"
                  :value="item.componentId" />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="2" style="text-align: center; line-height: 2">=</el-col>
          <el-col :span="17">
            <div style="
                width: 100%;
                height: 100%;
                border: 1px solid #dcdfe6;
                border-radius: 5px;
              " contentEditable="true" class="formula_assemble"></div>
          </el-col>
        </el-row>
        <el-row :gutter="5">
          <el-col :span="3" v-for="item in mathArray">
            <el-button type="success" class="formula_but" @click="insert(item.value)"
              style="width: 100%; margin-top: 5px">{{ item.label }}</el-button>
          </el-col>
        </el-row>
        <p class="pinformation" style="margin-top: 15px">规约</p>
        <el-row>
          <el-col :span="8">
            <el-form-item label="修约规则：" prop="ruleId">
              <el-select style="width: 100%" clearable filterable v-model="diyFormulaForm.ruleId">
                <el-option v-for="dict in sys_rule1" :key="dict.value" :label="dict.label"
                  :value="parseInt(dict.value)"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8">
            <el-form-item label="修约方法：" prop="modeId">
              <el-select style="width: 100%" clearable filterable v-model="diyFormulaForm.modeId">
                <el-option :value="1" label="保留小数点位数"></el-option>
                <el-option :value="2" label="保留有效数字位数"></el-option>
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="8" v-if="!diyFormulaForm.isSame1">
            <el-form-item label="修约位数：" prop="digitCount">
              <el-input clearable placeholder="请输入修约位数" v-model="diyFormulaForm.digitCount" />
            </el-form-item>
          </el-col>
        </el-row>
        <el-row>
          <el-form-item label="与参数保持一致：" label-width="120">
            <el-checkbox v-model="diyFormulaForm.isSame1" />
          </el-form-item>
          <el-col :span="8" style="margin-left: 15px;">
            <el-form-item label="大于等于：">
              <el-input clearable placeholder="请输入大于等于" v-model="diyFormulaForm.jclbName" />
            </el-form-item>
          </el-col>
          <el-col :span="6" style="line-height: 33px; padding-left: 15px">
            用科学计数法
          </el-col>
        </el-row>
        <el-form-item label="公式条件：">
          <el-row style="width: 100%" :gutter="10">
            <el-col :span="8">
              <el-select style="width: 100%" clearable filterable placeholder="请选择公式" v-model="diyFormulaForm.temp1">
                <el-option v-for="(item, index) in componentList" :key="item.componentId" :label="item.componentName"
                  :value="index" />
              </el-select>
            </el-col>
            <el-col :span="8">
              <el-select style="width: 100%" placeholder="请选择条件" v-model="diyFormulaForm.temp2" clearable>
                <el-option v-for="(dict, index) in sys_condition" :key="dict.value" :label="dict.label"
                  :value="dict.label"></el-option>
              </el-select>
            </el-col>
            <el-col :span="8">
              <el-input v-model="diyFormulaForm.temp3" clearable maxlength="100">
              </el-input>
            </el-col>
          </el-row>
        </el-form-item>
        <el-row>
          <p class="pinformation" style="margin-top: 8px">关联方法</p>
        <p class="totalStyle" style="margin-top: 6px">共 {{ methodList.length }} 条数据</p>
          <el-row style="margin-left: 10px">
            <el-button link type="success" icon="plus" @click="handleAddMethod">新增</el-button>
          </el-row>
        </el-row>
        
        <el-table :data="methodList" max-height="550px">
          <el-table-column label="方法编号" align="center" prop="methodCode" />
          <el-table-column label="方法名称" align="center" prop="methodName" />
          <el-table-column label="操作" align="center" width="150">
          <template #default="scope">
            <el-button link icon="Edit" @click="handleMethodEdit(scope.row)">编辑</el-button>
            <el-button link icon="Delete" @click="handleMethodDel(scope.row.methodId)">删除</el-button>
          </template>
        </el-table-column>
        </el-table>
        <p class="pinformation" style="margin-top: 15px">备注</p>
        <el-input v-model="diyFormulaForm.remark" type="textarea" :rows="6" maxlength="500"
          show-word-limit></el-input>
      </el-form>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="success" @click="define">确定</el-button>
          <el-button type="danger" @click="customOpen = false">关闭</el-button>
        </div>
      </template>
    </el-dialog>
    <el-dialog :class="'el-dialog-theme3'" append-to-body draggable fullscreen
      :close-on-click-modal="false" v-model="otherOpen" @close="otherDialogClose" title="选择其它控件">
      <el-form-item label="其它模板：">
        <el-select v-model="otherConForm.tableId" placeholder="请选择" filterable remote reserve-keyword remote-show-suffix
          :remote-method="remoteMethod1" :loading="loading6" class="custom-select1" style="width: 100%"
          @change="otherTableChange">
          <el-option v-for="item in mainList1" :key="item.tableId" :label="item.tableName" :value="item.tableId">
            <el-tooltip class="box-item" effect="customized" placement="right">
              <template #content>
                {{ item.tableName }}
              </template>
              <div style="
                  white-space: nowrap;
                  overflow: hidden;
                  text-overflow: ellipsis;
                ">
                {{ item.tableName }}
              </div>
            </el-tooltip>
          </el-option>
        </el-select>
      </el-form-item>
      <el-table :data="otherConList" class="business" @selection-change="handleSelectionChange" height="70vh">
        <el-table-column type="selection" width="55" align="center" />
        <el-table-column label="控件名称" align="center" prop="componentName"></el-table-column>
      </el-table>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="success" @click="otherDefine">确定</el-button>
          <el-button type="danger" @click="otherOpen = false">关闭</el-button>
        </div>
      </template>
    </el-dialog>
    <el-dialog :class="'el-dialog-theme3'" append-to-body draggable :close-on-click-modal="false"
      v-model="methodOpen" :title="methodTitle" width="500" >
        <el-form-item label="检测方法：" >
          <el-select v-model="methodId" filterable remote reserve-keyword remote-show-suffix
            :remote-method="remoteMethod" :loading="methodLoading" style="width: 100%">
            <el-option v-for="item in methodOptionList" :key="item.methodId" :value="item.methodId" :label="item.methodCode + item.methodName">
              <span v-html="getSupAndSub(item.methodName)"></span>
            </el-option>
          </el-select>
          </el-form-item>
      <template #footer>
        <div class="dialog-footer">
          <el-button type="success" @click="handleMethodSave">确定</el-button>
          <el-button type="danger" @click="methodOpen = false">关闭</el-button>
        </div>
      </template>
    </el-dialog>
  </div>
</template>

<script setup>
import bus from "@/utils/eventBus";
import {
  queryMethodList,
} from "@/api/store/method";
import {
  diyFormulaSave,
  getGsList,
  getEditForm,
  delGsList,
  delAllGsList,
  listTableMain,
  getTableTem,
  getSuitList1
} from "@/api/templateEditor/table";
import { nextTick } from "vue";

const route = useRoute();
const { proxy } = getCurrentInstance();

const { sys_rule1 } = proxy.useShareDict("sys_rule1");
const { sys_condition } = proxy.useDict("sys_condition");
const methodList = ref([]);
const methodOpen = ref(false);
const methodTitle = ref();
const methodId = ref();
const methodLoading = ref(false);
const methodOptionList = ref([]);
// 数学方法
const mathArray = ref([
  { label: "加", value: "+" },
  { label: "减", value: "-" },
  { label: "乘", value: "*" },
  { label: "除", value: "/" },
  { label: "左括号", value: "(" },
  { label: "右括号", value: ")" },
  { label: "绝对值", value: "abs()" },
  { label: "平方根", value: "sqrt()" },
  { label: "随机数", value: "random()" },
  { label: "正弦值", value: "sin()" },
  { label: "余弦值", value: "cos()" },
  { label: "正切值", value: "tan()" },
  { label: "反正弦值", value: "asin()" },
  { label: "反余弦值", value: "acos()" },
  { label: "反正切值", value: "atan()" },
  { label: "角度", value: "atan2()" },
  { label: "自然对数", value: "log10()" },
  { label: "x次幂", value: "exp(x)" },
  { label: "x的y次幂", value: "pow(x,y)" },
  { label: "最大值", value: "max()" },
  { label: "最小值", value: "min()" },
  { label: "四舍五入", value: "round()" },
  { label: "最小整数", value: "ceil()" },
  { label: "最大整数", value: "floor()" },
]);

const loading = ref(false);
const multipleForms = ref([]);

const diyFormulaRules = ref({
  resultId: [{ required: true, message: "公式不能为空", trigger: "blur" }],
  ruleId: [{ required: true, message: "修约规则不能为空", trigger: "blur" }],
  modeId: [{ required: true, message: "修约方法不能为空", trigger: "blur" }],
  digitCount: [
    { required: true, message: "修约位数不能为空", trigger: "blur" },
  ],
});

function getList() {
  loading.value = true;
  getGsList({ tableId: route.query.tableId }).then((res) => {
    loading.value = false;
    if (!res.data.length) {
      multipleForms.value = [];
      return;
    }
    multipleForms.value = res.data;
    nextTick(() => {
      multipleForms.value.forEach((item1, index) => {
        const divElement = document.querySelector(".formulation" + index + 1);
        divElement.innerText = "";
        let expressList = item1.formulaExpressDisplay.split("φ");
        expressList.forEach((item) => {
          let isComponent = item.split("Ψ");
          if (isComponent.length > 1) {
            let spanElement = document.createElement("span");
            spanElement.setAttribute("componentId", isComponent[0]);
            spanElement.setAttribute("contenteditable", "false");
            spanElement.textContent = isComponent[1];
            spanElement.className = "to_show_span";
            spanElement.style.cursor = "pointer";
            spanElement.addEventListener("click", function () {
              bus.emit("selectFormula", isComponent[0]);
            });
            divElement.appendChild(spanElement);
          } else {
            let textNode = document.createTextNode(item);
            divElement.appendChild(textNode);
          }
        });
      });
    });
  });
}

getList();
// ----------------------------- 匹配方法公式操作 ------------------------------

const componentList = ref([]);

function dialogClose() {
  diyFormulaForm.value = {
    tableId: route.query.tableId,
  };
  componentList.value = componentList.value.filter((item) => {
    return item.isOther !== 1;
  });
  let divElement = document.querySelector(".formula_assemble");
  if (divElement) {
    divElement.innerText = "";
  }
}

// -------------------------------- 自定义公式操作 --------------------------------
const customOpen = ref(false);
const diyFormulaForm = ref({
  tableId: route.query.tableId,
});
function handleCustomFormula() {
  customOpen.value = true;
}

function define() {
  proxy.$refs["diyFormulaFormRef"].validate((valid) => {
    if (valid) {
      const divElement = document.querySelector(".formula_assemble");
      if (!divElement.hasChildNodes()) {
        proxy.$modal.msgError("请输入完整公式！");
        return;
      }
      if (
        diyFormulaForm.value.temp1 === 0 ||
        diyFormulaForm.value.temp1 ||
        diyFormulaForm.value.temp2 ||
        diyFormulaForm.value.temp3
      ) {
        if (
          (diyFormulaForm.value.temp1 === 0 || diyFormulaForm.value.temp1) &&
          diyFormulaForm.value.temp2 &&
          diyFormulaForm.value.temp3
        ) {
          diyFormulaForm.value.formulaCondition =
            "φ" +
            componentList.value[diyFormulaForm.value.temp1].componentId +
            "φ" +
            diyFormulaForm.value.temp2 +
            diyFormulaForm.value.temp3;
          diyFormulaForm.value.formulaConditionDisplay =
            componentList.value[diyFormulaForm.value.temp1].componentName +
            diyFormulaForm.value.temp2 +
            diyFormulaForm.value.temp3;
        } else {
          delete diyFormulaForm.value.formulaCondition;
          delete diyFormulaForm.value.formulaConditionDisplay;
          proxy.$modal.msgError("公式条件不完整！");
          return;
        }
      } else {
        delete diyFormulaForm.value.formulaCondition;
        delete diyFormulaForm.value.formulaConditionDisplay;
      }
      if (diyFormulaForm.value.isSame1) {
        delete diyFormulaForm.value.digitCount
      }
      diyFormulaForm.value.isSame = diyFormulaForm.value.isSame1 ? 1 : 0
      diyFormulaForm.value.formulaExpressDisplay =
        proxy.getItemByArray(
          componentList.value,
          "componentId",
          diyFormulaForm.value.resultId,
          "componentName"
        ) + "=";
      divElement.childNodes.forEach((node) => {
        if (node.nodeType === Node.ELEMENT_NODE) {
          diyFormulaForm.value.formulaExpressDisplay += node.textContent;
        } else if (node.nodeType === Node.TEXT_NODE) {
          diyFormulaForm.value.formulaExpressDisplay += node.nodeValue;
        }
      });

      const spanElements = divElement.querySelectorAll("span[componentId]");
      diyFormulaForm.value.componentList = []
      Array.from(spanElements).map((spanElement) => {
        diyFormulaForm.value.componentList.push({ componentId: spanElement.getAttribute("componentId"), tableId: spanElement.getAttribute("tableId") })
      });
      const childNodes = divElement.childNodes;
      diyFormulaForm.value.formulaExpress = diyFormulaForm.value.resultId + "=";
      Array.from(childNodes).forEach((node) => {
        if (node instanceof HTMLSpanElement) {
          const componentId = node.getAttribute("componentId");
          if (componentId) {
            diyFormulaForm.value.formulaExpress += componentId;
          } else {
            diyFormulaForm.value.formulaExpress += node.innerText;
          }
        } else {
          diyFormulaForm.value.formulaExpress += node.textContent;
        }
      });
      diyFormulaForm.value.methodIds = methodList.value.map(item => {
        return item.methodId;
      })
      diyFormulaSave(diyFormulaForm.value).then((res) => {
        customOpen.value = false;
        getList();
        proxy.$modal.msgSuccess("保存成功");
      });
    }
  });
}

function getRange() {
  const selection = window.getSelection();
  if (selection.getRangeAt && selection.rangeCount > 0) {
    return { range: selection.getRangeAt(0), selection };
  }

  const formulaAssemble = document.querySelector(".formula_assemble");
  const range = document.createRange();
  range.selectNodeContents(formulaAssemble);
  range.collapse(false);
  return { range: range, selection };
}

function getSpan(className, text, id, tableId) {
  if (id) {
    const span = document.createElement("span");
    span.className = className;
    span.innerText = text;
    span.setAttribute("contenteditable", "false");
    span.setAttribute("componentId", id);
    span.setAttribute("tableId", tableId);
    return span;
  } else {
    return document.createTextNode(text);
  }
}

function insert(num, id, tableId) {
  const { range } = getRange();
  const span = getSpan("to_show_span", num, id, tableId);

  const formulaAssemble = document.querySelector(".formula_assemble");
  if (
    range.commonAncestorContainer === formulaAssemble ||
    (range.commonAncestorContainer.nodeType === Node.TEXT_NODE &&
      range.commonAncestorContainer.parentNode === formulaAssemble)
  ) {
    range.insertNode(span);
  } else {
    let lastChild = formulaAssemble.lastElementChild;
    if (!lastChild) {
      lastChild = formulaAssemble.lastChild;
    }
    if (lastChild && lastChild.nodeType === Node.TEXT_NODE) {
      formulaAssemble.insertBefore(span, lastChild.nextSibling);
    } else {
      formulaAssemble.appendChild(span);
    }
  }

  const newRange = document.createRange();
  newRange.setStartAfter(span);
  newRange.setEndAfter(span);

  const selection = window.getSelection();
  selection.removeAllRanges();
  selection.addRange(newRange);

  formulaAssemble.focus();
}

const height = ref();

// ----------------编辑--------------

function editFormula(val) {
  return new Promise((resolve, reject) => {
    getEditForm(val).then((res) => {
      diyFormulaForm.value = res.data;
      diyFormulaForm.value.isSame1 = !!diyFormulaForm.value.isSame
      if (res.data.formulaCondition) {
        for (let i = 0; i < componentList.value.length; i++) {
          if (
            componentList.value[i].componentId ===
            res.data.formulaCondition.split("φ")[1]
          ) {
            diyFormulaForm.value.temp1 = i;
            break;
          }
        }
        let temp = res.data.formulaCondition.split("φ")[2];
        diyFormulaForm.value.temp2 = temp.charAt(0); // 获取第一个字符
        diyFormulaForm.value.temp3 = temp.slice(1); // 从索引为1的位置开始截取到末尾
      }
      customOpen.value = true;
      resolve();
      nextTick(() => {
        const divElement = document.querySelector(".formula_assemble");
        if (diyFormulaForm.value.formulaExpress.charAt(0) === "φ") {
          diyFormulaForm.value.formulaExpress =
            diyFormulaForm.value.formulaExpress.slice(1);
        }
        let expressList = diyFormulaForm.value.formulaExpress.split("φ");
        expressList.forEach((item) => {
          let isComponent = item.split("Ψ");
          if (isComponent.length > 1) {
            let spanElement = document.createElement("span");
            spanElement.setAttribute("componentId", isComponent[0]);
            spanElement.setAttribute("tableId", isComponent[2]);
            spanElement.setAttribute("contenteditable", "false");
            spanElement.textContent = isComponent[1];
            spanElement.className = "to_show_span";
            divElement.appendChild(spanElement);
          } else {
            let textNode = document.createTextNode(item);
            divElement.appendChild(textNode);
          }
        });
      });
    });
  });
}

function copyFormula(val) {
  editFormula(val).then((res) => {
    delete diyFormulaForm.value.formulaId;
  });
}

// -------------删除---------------
function handleDelete(id) {
  const confirmMessage = id ? "确定要删除吗？" : "确定要全部删除吗？";
  proxy.$modal
    .confirm(confirmMessage)
    .then(async () => {
      loading.value = true;
      if (id) {
        await delGsList(id);
      } else {
        await delAllGsList(route.query.tableId);
      }
    })
    .then(() => {
      proxy.$modal.msgSuccess("删除成功");
      getList();
    })
    .catch(() => {
      loading.value = false;
    });
}

// ---------------------------修约规则----------------------------

bus.on("tempComponent", (val) => {
  componentList.value = val.filter((item) => {
    return item.isHide == 0;
  });
});

const loading6 = ref(false);
const loading7 = ref(false);
const mainList1 = ref([]);

function remoteMethod1(val) {
  if (val) {
    loading7.value = true;
    setTimeout(() => {
      let temp = {
        tableMain: 0,
        tableName: val,
        params: {},
      };
      temp.params["filterTableId"] = route.query.tableId;
      listTableMain(temp).then((res) => {
        loading7.value = false;
        mainList1.value = res.rows;
      });
    }, 200);
  } else {
    mainList1.value = [];
  }
}

// --------------------------------------选择其它控件--------------------------------------
const otherOpen = ref(false);
const otherConForm = ref({});
const otherConList = ref([]);
const beforDefine = ref([]);
function handleOtherControls() {
  otherOpen.value = true;
}

function otherTableChange(val) {
  getTableTem(val).then((res) => {
    otherConList.value = res.data;
  });
}

function handleSelectionChange(selection) {
  beforDefine.value = selection;
}

function handleAddMethod(){
  methodOpen.value = true;
}

function remoteMethod(methodCode){
  if (methodCode) {
    if(methodCode.length <= 2){
      return;
    }
    methodLoading.value = true;
    setTimeout(() => {
      let params = {
        methodCode: methodCode,
        tableId: route.query.tableId,
        params: {onlyMethod:true}
      };
      getSuitList1(params).then((res) => {
        methodLoading.value = false;
        methodOptionList.value = res.data;
      });
    }, 200);
  }  
}

function handleMethodEdit(row){
  debugger;
  handleAddMethod();
  methodOptionList.value = [{methodId: row.methodId, methodcode: row.methodCode,methodName: row.methodName}]
  methodId.value = row.methodId;
}

function handleMethodDel(selectedMethodId){
  for(let i in methodList.value){
      if(methodList.value[i].methodId == selectedMethodId){
        methodList.value.splice(i,1)
        proxy.$modal.msgSuccess("删除成功！");
        break;
      }
  }
}

function handleMethodSave(){
  const selectedMethod = methodOptionList.value.filter((method) =>{
    return method.methodId == methodId.value;
  });
  let selectedIndex;
  for(let i in methodList.value){
      if(methodList.value[i].methodId == methodId.value){
        selectedIndex = i;
        break;
      }
  }
  if(typeof selectedIndex == 'Number'){
    methodList.value.splice(selectedIndex,1,selectedMethod)
  }else{
    methodList.value.push(selectedMethod[0]);
  }
  methodOpen.value = false;
}

function otherDefine() {
  if (beforDefine.value.length === 0) {
    proxy.$modal.confirm("未选取其它控件，确定要关闭吗？").then(() => {
      otherOpen.value = false;
    });
  } else {
    beforDefine.value.forEach((item) => {
      item.tableId = otherConForm.value.tableId
      item.isOther = 1;
    });
    componentList.value = componentList.value.concat(beforDefine.value);
    componentList.value = Array.from(
      new Set(componentList.value.map((item) => item.componentId))
    ).map((componentId) => {
      return componentList.value.find(
        (item) => item.componentId === componentId
      );
    });
    otherOpen.value = false;
  }
}

function otherDialogClose() {
  otherConForm.value.tableId = "";
  otherConList.value = [];
}

function getHeight() {
  height.value = proxy.getSubFileHeight(proxy, "scrollbarRef");
}

function getMountedHeight() {
  nextTick(() => {
    getHeight();
    window.addEventListener("resize", getHeight);
  });
}

function getUnmountHeight() {
  window.removeEventListener("resize", getHeight);
}

defineExpose({
  getMountedHeight,
  getUnmountHeight,
});
</script>

<style lang="scss" scoped>
.mutipleFormsClass {
  margin-bottom: 10px;
  padding: 10px;
  border: 1px solid;
  border-radius: 15px;
}

:deep(.to_show_span) {
  background-color: skyBlue !important;
  color: #fff !important;
  margin: 0 5px;
  border-radius: 5px;
  padding: 3px 10px;
  height: 20px;
}
</style>
